/*
 * Copyright &copy; 2011-2020 lnint Inc. All right reserved.
 * 
 * 修改信息：【与SVN提交信息一致】
 * A: 新增类 王朋飞 2015-03-26 12:02:25
 */
package com.lnint.jess.modules.oa.dao;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;

import com.lnint.jess.common.persistence.BaseDao;
import com.lnint.jess.common.persistence.Parameter;
import com.lnint.jess.modules.oa.entity.Leave;

/**
 * <P>请假DAO</P>
 * 
 * @version 1.0
 * @author 王朋飞  2015-03-26 12:02:25
 * @since JDK 1.6
 */
@Repository
public class LeaveDao extends BaseDao<Leave> {
	
	/**
	 * 更新流程实例ID
	 * @param leave
	 * @return
	 */
	public int updateLeaveInstanceId(Leave leave) {
		if(StringUtils.isEmpty(leave.getId())) {
			return 0;
		}else {
			return update("update Leave set processInstanceId=:p1 where id = :p2", new Parameter(leave.getProcessInstanceId(),leave.getId()));
		}
	}
}
